import { ServerMessage, UserSession } from '../types';

export const WebSocketManagerToken = 'IWebSocketManager';

export interface CustomWebSocket extends WebSocket {
  id: string;
  user?: UserSession;
  data: Record<string, any>;
}

export interface IWebSocketManager {
  addConnection(ws: CustomWebSocket, user: UserSession): void;
  removeConnection(userId: string): void;
  broadcastToRoom(roomId: string, message: ServerMessage): void;
  sendToUser(userId: string, message: ServerMessage): void;
  getConnection(userId: string): CustomWebSocket | undefined;
}
